<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ attribute name="menuId" type="java.lang.String" required="true" description="当前菜单的ID" %>
<div class="breadcrumbs" id="breadcrumbs">
    <ul class="breadcrumb">
        <c:forEach items="${parentMenuList}" var="menu" varStatus="statu">
            <c:choose>
                <c:when test="${statu.index eq 0}">
                    <li>
                        <i class="ace-icon fa fa-home home-icon"></i>
                        ${menu.name}
                    </li>
                </c:when>

                <c:otherwise>
                    <li>
                        ${menu.name}
                    </li>
                </c:otherwise>
            </c:choose>

        </c:forEach>
    </ul><!-- /.breadcrumb -->

    <div class="nav-search" id="nav-search">
        <form class="form-search" style="display: none;">
                <span class="input-icon">
                    <input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
                    <i class="ace-icon fa fa-search nav-search-icon"></i>
                </span>
        </form>
        <div style="margin-top: 5px;margin-right: 20px;">
            <a href="javascript:;" class="search_link">高级查询</a>
        </div>
    </div><!-- /.nav-search -->
</div>
<script type="text/javascript">
    $(document).ready(function(){
        var url = "${ctx}/sys/menu/findParentMenu";
        var menuId = "${menuId}";
        $.post(url,{menuId:menuId},function(data){
            for(var i=0;i<data.length;i++){
                var str = "";
                if(i==0){
                    str += "<li>";
                    str += "<i class=\"ace-icon fa fa-home home-icon\"></i>";
                    str += "<a href=\"${ctx}/"+data[i].href+"\">"+data[i].name+"</a>";
                    str += "</li>";
                }else {
                    str += "<li>";
                    str += "<a href=\"${ctx}/"+data[i].href+"\">"+data[i].name+"</a>";
                    str += "</li>";
                }
                $(".breadcrumb").append(str);
            }
        });
    });

</script>